#ifndef __STACK_H__
#define __STACK_H__

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>

// #define TEST_STACK

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
  int top;
  const size_t size;
  int * const pdata;
} stack_t;


#define _new_stack(buff) { \
  .top = 0, \
  .size = sizeof(buff)/sizeof(int), \
  .pdata = (buff), \
}

bool push(stack_t *pstack, int data);

bool pop(stack_t *pstack, int *data);


#ifdef __cplusplus
}
#endif


#endif
